package cn.bugstack.domain.strategy.repositroy;

import cn.bugstack.domain.strategy.model.entity.StrategyAwardEntity;
import cn.bugstack.domain.strategy.model.entity.StrategyEntity;
import cn.bugstack.domain.strategy.model.entity.StrategyRuleEntity;

import java.util.HashMap;
import java.util.List;

/**
 * 策略仓储接口
 * 基础层中需要拿一些数据值，由仓储层帮忙处理基础数据
 */

public interface IStrategyRepository {

	List<StrategyAwardEntity> queryStrategyAwardList(Long strategyId);

	//根据策略id，概率区间大小，随机存储到一张策略奖品概率表
	void storeStrategyAwardSearchRateTables(String key, Integer  rateRange, HashMap<Integer, Integer> shuffleStrategyAwardSearchRateTables);

	//根据策略id 获取中奖区间
	int getRateRange(Long strategyId);

	int getRateRange(String strategyId);

	//根据策略id和随机获取的概率区间值获取奖品id
	Integer getStrategyAwardAssemble(String key, Integer ratekey);

	StrategyEntity queryStrategyEntityByStrategyId(Long strategyId);

	StrategyRuleEntity queryStrategyRule(Long strategyId, String ruleModel);

	String queryStrategyRuleValue(Long strategyId, Integer awardId, String ruleModel);

}
